<template>
    <div class="box1 bordert">
        <div class="payc">
            <img class="icon" src="../../assets/img/zfb.png" alt="">
            <span class="ml10">支付宝充值</span>
            <div class="mt30">
                <span>请选择充值面额：</span>
                <span class="ml10 colorb">({{ zdchongzhi }}起充)</span>
            </div>
            <!-- <div class="fleft mn">应付金额：<span class="howm">200</span>元</div> -->
            <div class="input">
                <div>输入充值金额</div>
                <div class="input2">￥
                    <input class="input3" type="text" v-model="czmoney">
                </div>
            </div>
        </div>
        <div class="bottomzfb">
            <div class="rcenter">
                <span>支付金额:</span>
                <span class="coloro">{{ czmoney }}</span>
                <span>元</span>
                <div class="querenz" @click="querenje">确认金额</div>
            </div>
            <div class="ewmf">
            <div class="ewm"><img class="ewmimg" :src="imgz" alt=""></div>
            </div>
            <div class="way fleft"><img class="icon" src="../../assets/img/zfb1.png" alt="">支付宝支付</div>
        </div>
    </div>
</template>
<script>
export default {
  data () {
    return {
        isPopupVisiblezfcg: false,
        czmoney:'',
        zdchongzhi:'',
        imgz:''
    }
  },
  created() {
    this.zuidi()
  },
  methods: {
    async zuidi() {
        const { data: res } = await this.$http.post('app/user/getChongzhi')
        console.log(res)
        if (res.code !== 0) return console.log('获取最低充值失败')
        console.log('获取最低充值成功')
        // this.czmoney = res.data
        this.zdchongzhi = res.data
    },
    async querenje() {
      if(this.czmoney == '') {
        alert('请输入充值金额')
      }else{
          console.log('12346')
      var id = JSON.parse(window.localStorage.getItem('yonghuxinxi')).id
      var czje = new FormData()
      czje.set('userId',id)
      czje.set('money',this.czmoney)
      const { data: res } = await this.$http.post('app/zqDeposit/payDeposit.do',czje)
        console.log(res)
        if (res.code !== 0) return alert(res.msg)
        console.log('返回充值方式成功')
        this.imgz = res.data.thirdPayParams_ali
      }
    }
  }
  }
</script>
<style lang="less" scoped>
@import "../../assets/css/index.css";
.box1 {
    height: 1000px;
    width: 100%;
    background-color: #fff;
    .payc {
        margin-left: 30px;
        padding-top: 30px;
        .input {
            margin-top: 20px;
            height: 100px;
            width: 93.5%;
            padding: 1%;
            border: 1px solid #DEDEDE;
            .input2 {
                margin-top: 20px;
                height: 50px;
                font-size: 40px;
                .input3 {
                    width: 600px;
                    height: 60px;
                    margin-left: 0px;
                    border: 0;
                    font-size: 40px;
                    outline:none;
                }
            }
        }
    }
    .bottomzfb {
        margin-top: 40px;
    }
}
.icon {
  height: 20px;
  width: 25px;
}
.money {
  margin: 15px 0 0 25px;
  height: 100px;
  width: 150px;
  border: 2px solid #FE3A00;
  text-align: center;
  line-height: 100px;
  color:  #FE3A00;
  font-size: 30px;
  font-weight: bold;
}
.fleft {
  float: left;
}
.mn {
  width: 100%;
  margin-top: 100px;
}
.howm {
  color:  #FE3A00;
  font-size: 30px;
}
.ewmf {
  float: left;
  width:100%;
}
.rcenter {
  position: relative;
}
.ewm {
  height: 200px;
  width: 200px;
  border: 2px solid #1296DB;
  margin: 30px auto;
}
.querenz {
  position: absolute;
  right: 80px;
  cursor: pointer;
  width: 100px;
  height: 30px;
  line-height: 30px;
  color: #fff;
  background-color: #FF8B19;
  z-index: 1;
}
.ewmimg {
  height: 200px;
  width: 200px;
}
.way {
  width: 100%;
  height: 20px;
  text-align: center;
}
.bordert {
  border-top:5px solid #DB2C54;
}

</style>